<titlemenu></titlemenu>
<div ng-if="examing" class="paper-box">
    <div>
        <span style="font-weight: bold">考试提醒</span>
        <br/><br/>
        共有 <span style="font-weight: bold;color: green">{{questionIndex}}</span>道题还剩
        <span style="font-weight: bold;color: blue">{{questionIndex-doneQuestionNumber}}</span>道未做
    </div>
    <div>
        距考试结束剩<span style="font-weight: bold;color: red">{{examendtip}}</span>
    </div>
    <div>
        <button type="submit" class="btn btn-primary" ng-click="submitExamTest()"> 交 卷
        </button>
    </div>
</div>
<div class="dj-card">
    <div class="dj-body test-paper" activate-input activate-select>
        <form role="form" novalidate
              name="editForm">
            <div class="dj-formtable">
                <div ng-if="examing==false" class="showpaper-header">
                    <table>
                        <tr>
                            <td colspan="4" style="text-align: center">
                                <img src="../../content/images/test-wait.png"
                                     style="margin: auto"/>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" style="font-weight: bold;text-align: center;color: red">考试未开始</td>
                        </tr>
                        <tr>
                            <td colspan="4" style="text-align: center">{{myexam.testName}}_卷面总分:{{myexam.paperScore}}分
                            </td>
                        </tr>
                        <tr>
                            <td>考生姓名：</td>
                            <td>{{userInfo.Name}}</td>
                            <td>所属组织：</td>
                            <td>{{userInfo.DPName}}</td>
                        </tr>
                        <tr>
                            <td>考试时间：</td>
                            <td colspan="3">{{myexam.testBeginDate}}至{{myexam.testEndDate|date:'yyyy-MM-dd HH:mm'}}</td>
                        </tr>
                        <tr ng-if="!examing">
                            <td colspan="4" style="text-align: center;">
                                距离考试开始还有
                                <span style="color: #0e1773;font-weight: bold;">{{examtip}}</span>
                            </td>
                        </tr>
                    </table>
                </div>
                <div ng-if="examing" class="test-paper-header">
                    <div class="test-paper-image">
                        <img src="../../content/images/test-info.png"
                             style="width: 300px;height: 200px"/>
                    </div>
                    <div class="test-paper-info">
                        <table>
                            <tr>
                                <td colspan="4" style="font-weight: bold;text-align: center;font-size: 18px;">
                                    {{myexam.testName}}
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" style="text-align: center">卷面总分：{{myexam.paperScore}}分</td>
                            </tr>
                            <tr>
                                <td>考生姓名：</td>
                                <td>{{userInfo.Name}}</td>
                                <td>所属组织：</td>
                                <td>{{userInfo.DPName}}</td>
                            </tr>
                            <tr>
                                <td>考试时间：</td>
                                <td colspan="3">{{myexam.testBeginDate}}至{{myexam.testEndDate}}</td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div ng-if="examing" class="table-responsive list-table-panel">
                    <div class="outoflow">
                        <div class="paper-type-view" ng-repeat="it in previewList|orderBy:'DIPLAY_ORDER'; " ng-switch
                             on="it.name">
                            <div class="paper-quesetion-type">
                                <img src="../../content/images/test-question.png"/>第{{$index+1}}部分： {{it.name}}
                                共{{it.questionNum}}题({{it.score}})分
                            </div>
                            <div class="paper-quesetion-body">
                                <div ng-repeat="ques in it.question;">
                                    <div class="paper-quesetion-question" ng-switch-when="单选题">
                                        <div class="paper-quesetion-content">
                                            <span class="paper-quesetion-num">{{ques.order}}/{{questionIndex}}</span>
                                            <span class="paper-quesetion-num"> {{it.name}}</span>
                                            {{ques.CONTENT}}<span
                                                class="paper-quesetion-score">({{ques.SCORE}}分)</span></div>
                                        <div
                                                ng-repeat="ans in ques.ANSWERS|orderBy:'ORDER'">
                                            <input name="rd_{{ques.order}}" type="radio" ng-model="ques.useranswer"
                                                   value="{{ans.PROVID_ANSWER_ID}}"
                                                   class="with-gap" id="rd_{{ques.order}}_{{$index}}"/>
                                            <label for="rd_{{ques.order}}_{{$index}}">{{options($index)}}、{{ans.ANSWER_NAME}}</label>
                                        </div>
                                    </div>
                                    <div class="paper-quesetion-question" ng-switch-when="填空题">
                                        <span class="paper-quesetion-num">{{ques.order}}/{{questionIndex}}</span>
                                        <span class="paper-quesetion-num"> 填空题</span>
                                        <span showpaper-Input ng-model="ques">
                                        </span>
                                        <span class="paper-quesetion-score">({{ques.SCORE}}分)</span>
                                    </div>
                                    <div class="paper-quesetion-question" ng-switch-when="判断题">
                                        <div class="paper-quesetion-content">
                                            <span class="paper-quesetion-num">{{ques.order}}/{{questionIndex}}</span>
                                            <span class="paper-quesetion-num"> 判断题</span>
                                            {{ques.CONTENT}}<span
                                                class="paper-quesetion-score">({{ques.SCORE}}分)</span></div>
                                        <div
                                                ng-repeat="ans in ques.ANSWERS|orderBy:'ORDER'">
                                            <input name="rd2_{{ques.order}}" type="radio" ng-model="ques.useranswer"
                                                   value="{{ans.PROVID_ANSWER_ID}}"
                                                   class="with-gap" id="rd2_{{ques.order}}_{{$index}}"/>
                                            <label for="rd2_{{ques.order}}_{{$index}}">{{ans.ANSWER_NAME}}</label>
                                        </div>
                                    </div>
                                    <div class="paper-quesetion-question" ng-switch-when="简答题">
                                        <div>
                                            <span class="paper-quesetion-num">{{ques.order}}/{{questionIndex}}</span>
                                            <span class="paper-quesetion-num"> 简答题</span>
                                            {{ques.CONTENT}}<span class="paper-quesetion-score">({{ques.SCORE}}分)</span>
                                        </div>
                                        <div ng-repeat="ans in ques.ANSWERS|orderBy:'ORDER'">
                                            <textarea name="txa_{{ques.order}}" type="text" ng-model="ques.useranswer"
                                       class="form-control" style="height:100px"/>
                                        </div>
                                    </div>
                                    <div class="paper-quesetion-question" ng-switch-when="多选题">
                                        <div class="paper-quesetion-content">
                                            <span class="paper-quesetion-num">{{ques.order}}/{{questionIndex}}</span>
                                            <span class="paper-quesetion-num"> 多选题</span>
                                            {{ques.CONTENT}}<span
                                                class="paper-quesetion-score">({{ques.SCORE}}分)</span></div>
                                        <div ng-repeat="ans in ques.ANSWERS|orderBy:'ORDER'">
                                            <input type="checkbox" ng-model="ans.useranswer"
                                                   value="{{ans.PROVID_ANSWER_ID}}"
                                                   id="ts_ckb_{{ques.order}}_{{$index}}"/>
                                            <label for="ts_ckb_{{ques.order}}_{{$index}}">{{options($index)}}、{{ans.ANSWER_NAME}}</label>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
